<?php
$this->headLink()
    ->appendStylesheet('jqGrid/themes/jqModal.css')
    ->appendStylesheet('jqGrid/themes/basic/grid.css')
    ;

$this->headScript()
    ->appendFile('jqGrid/jqModal.js')
    ->appendFile('jqGrid/jqDnR.js')
    ->appendFile('jqGrid/jquery.jqGrid.js')
    ->appendFile('js/pictures-grid.js')
    ;
?>

<? $this->headTitle('Pictures'); ?>
<? $this->placeholder('title')->set('Pictures'); ?>

<p>
    <a href="<?php echo $this->url(array('controller'=>'pictures', 'action'=>'add')); ?>">Add New Picture</a>
</p>
<dl class="zend_form">
<?
    echo $this->articleSelect;
?>
</dl>

<table id="picture-grid" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="grid-pager" class="scroll" style="text-align:center;"></div>

<!--<div id="picture-grid"></div>-->

<?php $this->headScript()->captureStart() ?>
jQuery(document).ready(function(){
    jQuery('#article_id').change(function(){
        reloadGrid(jQuery(this).val());
    });

    initGrid();
    reloadGrid(0);
});
<?php $this->headScript()->captureEnd(); ?>